package model;

public class Ghost {
	private int posX,posY;
	private static final int ghostTam = 15;

	private int direction; // 0=U,1=D,2=L,3=R,4=STILL
	
	Map level;
	
	// constructor
	public Ghost(int x, int y, Map map){
		posX = x;
		posY = y;
		level = map;
		
		direction = 0;
	}

	// returns the x-position
	public int getX() {
		return posX;
	}

	// returns the y-position
	public int getY() {
		return posY;
	}

	// returns ghost size
	public int getTam() {
		return ghostTam;
	}

	// for testing
	private long startTime = System.currentTimeMillis();
	private long delta = 1000;
	
	// TODO 
	// moves ghosts
	public void move() {
		long time = System.currentTimeMillis();
		if ( time - startTime > delta){
			startTime = time;
			direction = (direction+1)%5;		
		}
	}		

	// returns direction in which the ghost is moving
	public int getDirection(){
		return direction;
	}
}
